﻿<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%
         Response.ContentType = "text/xml";
        OleDbConnection conn = null;
        try
        {
            conn = DBOp.DbConn; 
            OleDbCommand comm = conn.CreateCommand();
            //comm.CommandText = "select total from jz2007 where 建筑统一编码 = '" + Request.Params["name"] + "'";
            comm.CommandText = "select year,total from 建筑用电电量总表 where 建筑统一编码 = '" + Request.Params["name"] + "' order by year";
            System.Data.DataTable dt = new System.Data.DataTable();
            OleDbDataAdapter oda = new OleDbDataAdapter(comm);
            oda.Fill(dt);            
            if(dt.Rows.Count != 1){                
                %>
                <chart caption='用电量统计' subcaption='（单位：千瓦时)' labelDisplay='ROTATE' slantLabels='1' xAxisName='年份' yAxisName='用电量' formatNumberScale='0' baseFontSize='12' baseFontFamily='宋体' numberPrefix='' showValues='0' alternateHGridColor='FCB541' alternateHGridAlpha='20' divLineColor='FCB541' divLineAlpha='50' canvasBorderColor='666666' baseFontColor='666666' lineColor='FCB541'>
                <%
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    %>
                <set label='<%=dt.Rows[i]["year"] %>年' value='<%=dt.Rows[i]["total"].ToString() %>' />
                        <%
                }
                     %>
                <styles><definition>  <style name='Anim1' type='animation' param='_xscale' start='0' duration='1' />   <style name='Anim2' type='animation' param='_alpha' start='0' duration='0.6' />   <style name='DataShadow' type='Shadow' alpha='40' />   </definition><application>  <apply toObject='DIVLINES' styles='Anim1' />   <apply toObject='HGRID' styles='Anim2' />   <apply toObject='DATALABELS' styles='DataShadow,Anim2' />   </application>  </styles>  </chart>
                <%
            }
        }
            catch(Exception ex){
            }
                    finally{
                        if (conn != null)
                            conn.Close();
        }
                        %>
